﻿#ifndef USERSERVICE_H
#define USERSERVICE_H

#include "userdao.h"
#include <QObject>

class UserService : public QObject
{
    Q_OBJECT
public:
    explicit UserService(QObject *parent = nullptr);
    ~UserService();
    bool getList(QList<User> &list, const QVariantMap &param = {});
    bool getTotal(uint64_t &total, const QVariantMap &param = {});
    bool getOne(User &object);
    bool saveOne(User &object, QBaseEntity::PropertiesType propertiesType = QBaseEntity::AllProperty, QStringList properties = {});
    bool deleteOne(User &object);

private:
    QSqlDatabase db;
};

#endif // USERSERVICE_H
